//**********************************************************************************
//GMCProj42.java
//
//Name: Gabriel Martins	de	Castro
//Class:	COMSC	110L.51
//Date: /2014
//Instructor: Dr.	Chunyan Bai
//
//Purpose: Write a Java program using nested loops to print out the patterns
//***********************************************************************************

public class GMCProj42
{
   public static void main (String[] args)
   {
      //Pattern1
      for(int lin = 0;lin <5; lin++)
      {
         for(int col = lin; col >= 0; col--)
            System.out.print(" * ");
         System.out.println();
      }
      
      System.out.print("\n\n\n");
      
      //Pattern2
      for(int lin = 5;lin >0; lin--)
      {
         for(int col = lin; col > 0; col--)
            System.out.print(" * ");
         System.out.println();
      }
      
      System.out.print("\n\n\n");
      
      //Pattern3
      for(int lin = 5;lin >0; lin--)
      {
         for(int tab = (5-lin); tab > 0; tab--)
            System.out.print("   ");
         for(int col = lin; col > 0; col--)
            System.out.print(" * ");
         System.out.println();
      }
      
      System.out.print("\n\n\n");
      
      /*
      //Pattern4
      for(int lin = 0;lin <=5; lin++)
      {
         for(int tab = (5-lin); tab > 0; tab--)
            System.out.print("   ");
         for(int col = lin; col >= 0; col--)
            System.out.print(" . ");
         System.out.println();
      }
      
      System.out.print("\n\n\n");
      */
      
      //Pattern5
      for(int lin = 1,lin2 = 2;lin <=5; lin+=2, lin2 -=1)
      {
         for(int tab = lin2; tab > 0; tab--)
            System.out.print("   ");
         for(int col = lin; col > 0; col--)
            System.out.print(" * ");
         System.out.println();
      }
      for(int lin = 5,lin2 = 0;lin >0; lin-=2, lin2 +=1)
      {
         for(int tab = lin2; tab > 0; tab--)
            System.out.print("   ");
         for(int col = lin; col > 0; col--)
            System.out.print(" * ");
         System.out.println();
      }
   }
}
